package com.qlu.casualtalk.mapper;

import com.qlu.casualtalk.domain.po.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    @Select("SELECT * FROM user WHERE account = #{account}")
    User findUserByAccount(String account);

    @Select("SELECT * FROM user WHERE phone = #{phone}")
    User findUserByPhone(String phone);

    @Select("SELECT * FROM user WHERE email = #{email}")
    User findUserByEmail(String email);


    void insert(User user);

    void updateById(User user);

    @Select("SELECT * FROM user WHERE id = #{id}")
    User findUserById(Integer id);
}
